<div ng-controller="successCtrl">
    <div class="task-container col-md-8 col-lg-8 col-md hidden-sm hidden-xs">
        <div class="panel panel-primary">
            <div class=" panel-heading">便签
                <button class="btn btn-danger btn-xs pull-right">
                    <i class="glyphicon glyphicon-plus"></i>
                </button>
            </div>
            <div class="panel-body"></div>
        </div>
    </div>
    <div class="slide-right col-md-4 col-lg-4 col-xs-12">
        <div class="panel panel-primary">
            <div class="panel-heading">任务面板
                <button class="btn btn-info btn-xs pull-right" ng-click="exit()">
                   <i class="glyphicon glyphicon-exclamation-sign"></i>退出系统
                </button>
            </div>
            <div class="panel-body">
                <div class="task-part">
                    <form ng-submit="addTask()">
                        <div>
                            <div class="input-group">
                                <input type="text" class="input-sm form-control" placeholder="输入名称或用户名" ng-model="task.description" required>
                                <span class="input-group-btn">
                                    <button class="btn btn-sm btn-primary">
                                        <span class="text">增加</span>
                                        <i class="fa fa-spin fa-spinner"></i>
                                    </button>
                                </span>
                            </div>
                        </div>
                        <hr>
                    </form>

                    <table class="table table-striped table-hover table-bordered task-list">
                        <tr ng-repeat="task in taskList track by $index">
                            <td class="text-center td-one" ng-if="!task.isEditing"><input type="checkbox" ng-model="task.checked"></td>
                            <td class="td-two" ng-class=" {'td-two-two':task.checked} ">
                                <span ng-hide="task.isEditing">{{task.description}}</span>
                                <input type="text" class="form-control input-sm" ng-model="task.tempTaskName"  ng-show="task.isEditing">
                            </td>
                            <td class="td-three" ng-if="!task.checked">
                                <div class="btn-group" ng-hide="task.isEditing">
                                    <button class="btn btn-info btn-xs" ng-click="editTask(task,$index)">编辑</button>
                                    <button class="btn btn-danger btn-xs" ng-click="deleteTask($index)">删除</button>
                                </div>
                                <div class="btn-group" ng-show="task.isEditing">
                                    <button class="btn btn-info btn-xs" ng-click="save(task)">保存</button>
                                    <button class="btn btn-danger btn-xs" ng-click="cancel(task)">取消</button>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>